package com.example.springbackfront.controller;

import com.example.springbackfront.mapper.StudentMapper;
import com.example.springbackfront.test.Student;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.hibernate.validator.constraints.Length;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Validated
@Controller
@Tag(name="账号验证",description = "用户查询登陆等")
public class TestController {

    @Resource
    StudentMapper mapper;
    @GetMapping("/login")
    public String login(){
        return "login";
    }


    @ResponseBody
    @GetMapping("/test")
    public Student test(){
        return mapper.findUserById(2);
    }
}
